/*
 * EDAS2 - TetraTech, Inc.
 *
 * Distributable under GPL license.
 * See terms of license at gnu.org.
 */
package com.tetratech.edas2.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * MeasurementUnit generated by hbm2java
 */
@Entity
@Table(name = "ED_MEASUREMENT_UNIT")
public class MeasurementUnit extends AttributableUpdateRetireEntity
		implements
			java.io.Serializable {

	private Long uid;
	private String code;
	private String description;
	private Set<MonitoringLocation> monitoringLocationsForMsuntUidVerticalMeasure = new HashSet<MonitoringLocation>(
			0);
	private Set<MonitoringLocation> monitoringLocationsForMsuntUidHorizontalAccuracy = new HashSet<MonitoringLocation>(
			0);
	private Set<ResultFrequencyClass> resultFrequencyClasses = new HashSet<ResultFrequencyClass>(
			0);

	public MeasurementUnit() {
	}

	public MeasurementUnit(Long uid, String code) {
		this.uid = uid;
		this.code = code;
	}

	@Id
	@Column(name = "MSUNT_UID", unique = true, nullable = false, precision = 6, scale = 0)
	@NotNull
	public Long getUid() {
		return this.uid;
	}

	public void setUid(Long uid) {
		this.uid = uid;
	}

	@Column(name = "MSUNT_CD", nullable = false, length = 12)
	@NotNull
	@Length(max = 12)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "MSUNT_DESC", length = 200)
	@Length(max = 200)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "measurementUnitByMsuntUidVerticalMeasure")
	public Set<MonitoringLocation> getMonitoringLocationsForMsuntUidVerticalMeasure() {
		return this.monitoringLocationsForMsuntUidVerticalMeasure;
	}

	public void setMonitoringLocationsForMsuntUidVerticalMeasure(
			Set<MonitoringLocation> monitoringLocationsForMsuntUidVerticalMeasure) {
		this.monitoringLocationsForMsuntUidVerticalMeasure = monitoringLocationsForMsuntUidVerticalMeasure;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "measurementUnitByMsuntUidHorizontalAccuracy")
	public Set<MonitoringLocation> getMonitoringLocationsForMsuntUidHorizontalAccuracy() {
		return this.monitoringLocationsForMsuntUidHorizontalAccuracy;
	}

	public void setMonitoringLocationsForMsuntUidHorizontalAccuracy(
			Set<MonitoringLocation> monitoringLocationsForMsuntUidHorizontalAccuracy) {
		this.monitoringLocationsForMsuntUidHorizontalAccuracy = monitoringLocationsForMsuntUidHorizontalAccuracy;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "measurementUnit")
	public Set<ResultFrequencyClass> getResultFrequencyClasses() {
		return this.resultFrequencyClasses;
	}

	public void setResultFrequencyClasses(
			Set<ResultFrequencyClass> resultFrequencyClasses) {
		this.resultFrequencyClasses = resultFrequencyClasses;
	}

}
